package com.bana.sys.task;

import com.bana.sys.service.FileService;
import com.bana.sys.service.LogService;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Scheduled;

import javax.annotation.Resource;

@Configuration
public class SystemTask {

    @Resource
    private LogService logService;

    @Resource
    private FileService fileService;

    @Scheduled(cron = "0 0 0 * * *")
    public void handle()
    {
        logService.deleteSystemLogs();
        logService.deleteSocketLog();
        fileService.deleteTempFiles();
    }
}
